<?php
/** @name : DummyUserController.php via KOOK-FRAMEWORK - @author : theerasak.p - @since : 13 �.�. 2554 19:07:33 - @encoding : UTF-8 */
require_once Path::interfaces("controller");
require_once Path::models("dummyUser");
require_once Path::managers("dummyUser");

class DummyUserController extends DummyUserManager implements ControllerInterface
{
	public function home()
	{

	}

	public function insert()
	{
		Console::write("Enter ".get_class($this)." -> ".__FUNCTION__);

		$instance = new DummyUserController();
		$instance->mapping();
		$instance->set("dummyUserNo",1);
		$instance->set("dummyUserName","bb");
		$instance->save($instance);

		Console::write("Exit ".get_class($this)." -> ".__FUNCTION__);
	}

	public function update()
	{
		Console::write("Enter ".get_class($this)." -> ".__FUNCTION__);

		$instance = new DummyUserController();
		$instance->mapping();
		$instance->set("dummyUserNo",1);
		$instance = parent::find($instance);
		$instance['DummyUser']->set("dummyUserName","updateDummyUserName");
		$instance['DummyUser'] = $instance['DummyUser']->save($instance['DummyUser']);
		echo "version of new is : ".$instance['DummyUser']->getVersion();

		Console::write("Exit ".get_class($this)." -> ".__FUNCTION__);
	}

	public function delete()
	{
		Console::write("Enter ".get_class($this)." -> ".__FUNCTION__);

		$instance = new DummyUserController();
		$instance->mapping();
		$instance->set("dummyUserNo",1);
		$instance->deleteManager($instance);

		Console::write("Exit ".get_class($this)." -> ".__FUNCTION__);
	}

	public function find()
	{
		Console::write("Enter ".get_class($this)." -> ".__FUNCTION__);

		$instance = new DummyUserController();
		$instance->mapping();
		$instance = $instance->find($instance);
		echo $instance['DummyUser']->get("dummyUserName");//parent::view("Default");

		Console::write("Exit ".get_class($this)." -> ".__FUNCTION__);
	}
}
?>